package servlet;

import model.classes;
import model.users;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

@WebServlet(value = "/a_seeClassInfo")
public class a_seeClassInfo extends HttpServlet{
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        HashMap<users,classes> hashMap= classes.allClassesInfo();
        if(!hashMap.isEmpty()) {

            req.setAttribute("allClassInfo",hashMap);
            req.getRequestDispatcher("/jsp/a_seeClassInfo.jsp").forward(req,resp);
        }
    }


    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req,resp);
    }
}
